<div class="row" style="height:100%;">
    <div class="col-lg-12" style="border-right:1px solid #e6e6e6;padding-right:0px;">
        <h1 class="site-h1" style="background-color:#FFFFFF;">技能组列表
            <#if skillList??>（${skillList?size}）</#if>
            <span style="float:right;">
                <button class="layui-btn layui-btn-sm green" href="/admin/callcenter/skill/add.html?hostid=${pbxHost.id!''}" data-toggle="ajax" data-width="550" data-height="360" data-title="添加技能组">添加技能组</button>
                <#if skillList?? && (skillList?size gt 0)><button class="layui-btn layui-btn-sm green" href="/admin/callcenter/skill/imp.html?hostid=${pbxHost.id!''}" data-toggle="ajax" data-width="550" data-height="450" data-title="导入坐席">导入坐席</button></#if></span>
        </h1>
        <div class="row">
            <div class="col-lg-12" style="padding-left:5px;">
                <div class="layui-collapse" lay-filter="skillcollapse">
                	<#if skillList??>
                	<#list skillList as skill>
                    <div class="layui-colla-item">
                        <h2 class="layui-colla-title">${skill.name!''}（${skill.skill!''}）
                        	<span style="float:right">
									<a class="layui-btn layui-btn-sm green opera-btn" href="/admin/callcenter/skill/edit.html??hostid=${pbxHost.id!''}&id=${skill.id!''}" data-toggle="ajax" data-width="550" data-height="360" title="编辑">
										编辑
									</a>
									<a class="layui-btn layui-btn-sm layui-btn-danger opera-btn" href="/admin/callcenter/skill/delete.html?id=${skill.id!''}" data-toggle="tip"  title="确定要删除队列吗？" data-callback="loadURL" data-target="#callCenterContent">
										删除
									</a>
							</span>
                        </h2>
                        <div class="layui-colla-content layui-show" style="padding:0px;">
                            <table class="layui-table" lay-skin="line" style="border-left:0px;">
                                <colgroup>
                                    <col width="30%">
                                    <col width="20%">
                                    <col width="1%">
                                    <col>
                                </colgroup>
                                <tbody>
                                    <#if skillExtentionList??>
                                        <#list skillExtentionList as skillExtention>
                                        <#if skillExtention.skillid == skill.id>
                                            <tr>
                                                <td>${skillExtention.extention!''}</td>
                                                <td>${skillExtention.createtime?string("yyyy-MM-dd HH:mm:ss")}</td>
                                                <td style="white-space:nowrap;" nowrap="nowrap">
                                                    <a href="/admin/callcenter/skill/extention/delete.html?id=${skillExtention.id!''}&hostid=${pbxHost.id!''}" data-target="#callCenterContent" data-callback="loadURL" style="margin-left:10px;" data-toggle="tip" data-title="请确认是否将分机移除？">
                                                        <i class="layui-icon" style="color:red;">&#x1006;</i>移除</a>
                                                </td>
                                            </tr>
                                        </#if>
                                        </#list>
                                    </#if>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    </#list>
                    </#if>
                </div>
            </div>
        </div>
    </div>
</div>
<script>layui.use('element',
    function() {
        var element = layui.element;
        element.render('collapse');
        
        $(".opera-btn").click(function(){
        	var obj = $(this).parents(".layui-colla-item").find(".layui-colla-content");
        	if(obj.hasClass("layui-show")){
        		obj.removeClass("layui-show");
        		element.render('collapse');
        	}else{
        		obj.addClass("layui-show");
        		element.render('collapse');
        	}
        })
    });
</script>